@echo off
cd %~dp0



:SET_VAR
set LOG_FILE=%CD%\log.txt
if exist %LOG_FILE% del /f %LOG_FILE%



:GENERATE_DOC
echo *** Doxygen has started
if exist .\MILBCM0_API_Specification rd /s /q .\MILBCM0_API_Specification
doxygen .\MILBCM0_API.doxy >> %LOG_FILE% 2>&1
echo *** Doxygen has finished
if exist "C:\Program Files\HTML Help Workshop\hhc.exe" goto GENERATE_HTMLHELP
if exist "C:\Program Files (x86)\HTML Help Workshop\hhc.exe" goto GENERATE_HTMLHELP
goto PRINT_LOG



:GENERATE_HTMLHELP
echo *** HTML Help has started
if exist .\MILBCM0_API.chm del /f .\MILBCM0_API.chm
if exist "C:\Program Files\HTML Help Workshop\hhc.exe" "C:\Program Files\HTML Help Workshop\hhc.exe" .\MILBCM0_API_Specification\index.hhp >> %LOG_FILE%
if exist "C:\Program Files (x86)\HTML Help Workshop\hhc.exe" "C:\Program Files (x86)\HTML Help Workshop\hhc.exe" .\MILBCM0_API_Specification\index.hhp >> %LOG_FILE%
if exist .\MILBCM0_API_Specification rd /s /q .\MILBCM0_API_Specification
echo *** HTML Help has finished
goto PRINT_LOG



:PRINT_LOG
echo ---
type %LOG_FILE%
echo ---
goto EXIT



:EXIT
